﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLK.Database.DALs;

namespace QLK.Database.BLLs
{
    public class StorageBLL
    {
        private StorageDAL dal;

        public StorageBLL()
        {
            dal = new StorageDAL();
        }

        public List<Storage> StorageGetAll()
        {
            return dal.StorageGetAll();
        }

        public Storage StorageGetByID(int storageID)
        {
            if (storageID > 0)
                return dal.StorageGetByID(storageID);
            return null;
        }

        public bool StorageInsert(Storage st)
        {
            if (dal.StorageCheckDuplicateName(st.StoregeName))
                return dal.StorageInsert(st);
            return false;
        }

        public bool StorageUpdate(Storage st)
        {
            if (dal.StorageCheckDuplicateName(st.StoregeName))
                return dal.StorageUpdate(st);
            return false;
        }

        public bool StorageDeleteID(int storageID)
        {
            return dal.StorageDeleteID(storageID);
        }

    }
}
